package 集合框架;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Maptest {
    public static void main(String[] args) {
        Map map=new HashMap();
        map.put("n","no,1");
        map.put("b","no,2");
        map.put("m","no,3");
        String result=(String)map.get("n");
        System.out.println(result);
        System.out.println("map=="+map.size());
        Set keySet =map.keySet();
        Iterator keyIt=keySet.iterator();
        while (keyIt.hasNext()){
            String key=(String)keyIt.next();
            String value=(String) map.get(key);
            System.out.println(value+"\t");
        }
        Set entrySet=map.entrySet();
        for (Object obj:entrySet){
            Map.Entry entry=(Map.Entry)obj;
            System.out.println(entry);

        }

    }


}
